/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anism.holidays.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author user
 */
@Embeddable
public class ClearancePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "employee")
    private int employee;
    @Basic(optional = false)
    @NotNull
    @Column(name = "holidaysType")
    private int holidaysType;

    public ClearancePK() {
    }

    public ClearancePK(int employee, int holidaysType) {
        this.employee = employee;
        this.holidaysType = holidaysType;
    }

    public int getEmployee() {
        return employee;
    }

    public void setEmployee(int employee) {
        this.employee = employee;
    }

    public int getHolidaysType() {
        return holidaysType;
    }

    public void setHolidaysType(int holidaysType) {
        this.holidaysType = holidaysType;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) employee;
        hash += (int) holidaysType;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ClearancePK)) {
            return false;
        }
        ClearancePK other = (ClearancePK) object;
        if (this.employee != other.employee) {
            return false;
        }
        if (this.holidaysType != other.holidaysType) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.an.ism.holidays.ClearancePK[ employee=" + employee + ", holidaysType=" + holidaysType + " ]";
    }
    
}
